﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using MyGeneration.dOOdads;
using MethodIT.Helper;

using Hr20.DAL;
using Hr20.BLL;
using Hr20.ProcessFlow;

namespace Appraisal.Web.Common
{
    public partial class SelectBidder : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                LoadData();
            }
        }

        private void LoadData()
        {
            ZB_Bidder b = new ZB_Bidder();
            b.Where.FullName.Value = "%" + txtName.Text + "%";
            b.Where.FullName.Operator = WhereParameter.Operand.Like;
            b.Where.Enable.Value = "Y";
            b.Query.Load();
            dg.DataSource = b.DefaultView;
            dg.DataBind();
        }

        protected void dg_SelectedIndexChanged(object sender, EventArgs e)
        {
            string ID = dg.SelectedItem.Cells[1].Text;
            string Name = dg.SelectedItem.Cells[2].Text;
            JScriptSet.ClosePopWindowsRetVal(Name, ID);
        }

        protected void lbtnMakeChoose_Click(object sender, EventArgs e)
        {
            LoadData();
        }
    }
}
